import React, { FC } from 'react'
import {Outlet} from 'react-router-dom'
import { Spin } from 'antd'
import useLoadUserData from '../hooks/useLoadUserData'
import useNavPage from '../hooks/useNavPage'
const QuestionLayout: FC = () => {
  // 加载用户信息
  const {waitingUserData}=useLoadUserData()
  // 用户未登录时跳转到登录页面
  useNavPage(waitingUserData)
  return (
    <div style={{height:'100vh'}}> 
    <div> {waitingUserData ?<div style={{textAlign:'center',marginTop:"80px"}}><Spin/></div>:<Outlet />}</div>
    </div>
  )
}
export default QuestionLayout